package work;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.hibernate.Session;

import ORM.Action;
import ORM.HibernateUtil;
import ORM.Member;
import net.sf.json.JSONArray;

public class actionmanage {
	public JSONArray getmemberbyID(String id)
	{
		ArrayList actionlist = new ArrayList();
		String q_id = "Lib-00"+id;
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		session.beginTransaction();
		List list = session.createQuery("from Action where ActionLib = '"+q_id+"'").list();
		Iterator iterator = list.iterator();
		while(iterator.hasNext()){
			Action act = (Action) iterator.next();
			actionlist.add(act);
		}
		session.getTransaction().commit();
		return JSONArray.fromObject(actionlist.toArray());

	}
}
